﻿using Api.Shared.Model.XinYa;
using Api.Shared.Utils;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;

namespace FitterTest.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [EnableCors("any")]
    public class KxController : ControllerBase
    {

        [HttpPost]
        public ActionResult<XyApiResponse<XyTaskData>> KxPost([FromBody] XyTaskData xyTaskData)
        {
            xyTaskData.TaskStauts = "2";

            XyApiResponse<XyTaskData>? resp =
                new()
                {
                    Message = "Success!",
                    Result = xyTaskData,
                    Status = true,
                    Code = 200
                };
            return resp;
        }

        [HttpGet]
        public ActionResult<XyApiResponse<KxData>> KxGet()
        {
            KxData kxData = new KxData() { Name = "测试" };
            XyApiResponse<KxData>? resp =
                new()
                {
                    Message = "Success!",
                    Result = kxData,
                    Status = true,
                    Code = 200
                };
            return resp;
        }

    }
}
